<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var x = 1;
        var obj = {
            x: 2,
            fun: function () {
                var x = 3;
                return this.x
            }
        }
        var fun = obj.fun;
        console.log(obj.fun(), fun());

        a = new Array(1, 2, 4, 6, 8);
        sum = 0;
        for (i = 1; i < a.length; i += 2)
            sum += a[i];
        console.log(sum);
    </script>
    <script>
        function fn(num) {
            let a = parseInt(num / 10);
            let b = num % 10;
            if (b > 0) {
                return (a + 1) * 10;
            } else {
                return a * 10;
            }
        }
        console.log(fn(36));
    </script>

</body>

</html>